package one.stand.feign;

import one.stand.fallback.OssFallBack;
import one.stand.model.ResultModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
 * @author Administrator
 */
@Component
@FeignClient(value = "file-service", fallback = OssFallBack.class, decode404 = true)
public interface OssFegin {


    /**
     * 上传文件
     * @param file
     * @return
     */
    @PostMapping(value = "/file/uploadObjectOSS",consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    ResultModel<String> uploadObjectOSS(@RequestPart MultipartFile file);

    /**
     * 上传多文件
     * @param files
     * @return
     */
    @PostMapping(value = "/file/uploadObjectOSSs",consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    ResultModel<String> uploadObjectOSSs(@RequestPart MultipartFile[] files);

}
